package com.demo.controller;

import com.demo.model.User;
import com.demo.service.impl.SystemServiceImpl;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.IntStream;

@RestController
public class IndexController   {
    @Autowired
    SystemServiceImpl systemServiceImpl;

    @RequestMapping("index")
    public String index(){
        String systemVersion=systemServiceImpl.getSystemVersion();
        return systemVersion;
    }

    @PostMapping("index2")
    public Object index2(){
        User user=new User();
        user.setId("111");
        user.setSex("sex");
        user.setAge(18);
        user.setName("luobiao");
        List list=new ArrayList();
        IntStream.range(0,100).forEach(f->{
            list.add(user);
        });
        return list;

    }

    @PostMapping("index3")
    public Object index3(){
        return "1111";

    }
}
